package com.cyy.cn.service;



import com.cyy.cn.dao.CommentDao;
import com.cyy.cn.pojo.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import util.IdWorker;

import java.util.List;


/**
 * spit服务层
 * 
 * @author Administrator
 *
 */
@Service
public class CommentService {

	@Autowired
	private CommentDao commentDao;
	
	@Autowired
	private IdWorker idWorker;

	public void add(Comment comment){
		comment.set_id(idWorker.nextId() + "");
		commentDao.save(comment);
	}

	public List<Comment> findByArticleid(String articleid){
	    return commentDao.findByArticleid(articleid);
    }
}
